package com.ruizhong.centercontroll.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.ruizhong.centercontroll.entity.TPage;
import com.ruizhong.centercontroll.util.XmlPageMap;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.xml.bind.JAXBException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface TPageService extends IService<TPage> {
    Integer saveNewPage(TPage tPage);

    TPage getPageInfoByPageName(String pageName);

    Integer getPageIdByPageName(String pageName);

    void saveAllComponents(Map<String, List<Map<String, Object>>> conditionMap, Integer pageId, String token,boolean isNew);



    HashMap<String, Object> getAllComponentByPageName(String pageName, Double aimPageWidth, Double aimPageHeight, Boolean display) throws JsonProcessingException;

    void updatePage(TPage tPage);

    List<TPage> getAllPages();

    void delPageByPageId(Integer pageId);

    void initPage(Integer pageId, String tokenId, Map<String, Object> variableMap, String clientIp);

    void updatePageImg(Map<String, String> conditionMap);

    ResponseEntity<InputStreamResource> outputPage(String pageName) throws JsonProcessingException, JAXBException;

    XmlPageMap ImportPageXmlTemplate(MultipartFile file);
}
